Computer systems provide various resources for storing data, such as, for example, random access memory (RAM), read-only memory (ROM), hard disks, tapes, or optical drives. Some or all of a computer system's data storage resources may be provided to the operating system or to software applications. Memory management is the process by which these data storage resources are administered so that a software application may allocate and access those resources. When a software application relinquishes use of data storage resources, memory management may allow those resources to be reused by other software applications.
In a computer system, data storage resources are managed at three different levels: (1) at the hardware level; (2) at the operating system level; and (3) at the application level. At the hardware level, a computer system provides an interface to physical data storage devices that are a part of the computer system or that are coupled to the computer system. For example, hardware memory management may include providing an interface to physical RAM using a cache to improve access speeds. Hardware memory management provides an interface to data storage resources for an operating system.
At the operating system level, memory management exploits data storage resources provided by the hardware level to allow one or more software applications to access those data storage resources. At this level, the computer system may implement various features, such as, for example, virtual memory and data security. Virtual memory allows the computer system to surpass resource limitations of physical RAM using auxiliary data storage (e.g., hard drive). The data security features provided by operating systems allow each application to run independently of one another to prevent errors in one application (or malicious code) from adversely affecting other applications.
At the application level, software applications request memory from the operating system and manage the use of that memory in those software applications. Often, the memory management functions of a software application are provided by the programming environment used to create the application. For example, Java and C++ programming environments each provide an application level memory management system to provide efficient interaction with data storage resources in a wide variety of applications.